package com.it.gmall.cart.client;

import com.it.gmall.model.cart.CartInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@FeignClient(name = "service-cart")
public interface CartFeignClient {
    // 点击加入购物车-加入
    @PostMapping("/api/cart/addCart/{skuId}/{skuNum}")
    public void addCart(@PathVariable  long skuId, @PathVariable Integer skuNum);

    // 点击加入购物车-查询
    @GetMapping("/api/cart/toCart/{skuId}")
    public CartInfo toCart(@PathVariable long skuId);

    // 点击去购物车结算
    @GetMapping("/api/cart/goToCart")
    public List<CartInfo> goToCart();

    // 获取选中的商品清单
    @GetMapping("/api/cart/getCheckedCartInfo")
    public List<CartInfo> getCheckedCartInfo();
}
